% This script generates Figures A.3 and A.5 in the online appendix.
% Figure A.3: Counterfactural path of phi_S
% Figure A.5: Labor's Share of Income in Manufacturing
%% Load data and model-generated results from benchmark calibration and counterfactual experiments.
clearvars;
BM = load('BM.mat');
year = 1950:1:2000;
phiS_half_slow = load('CF_phiS_half_slow.mat');
Data = table2array(readtable('time_series_shares.xlsx','Range','C30:BA31'));
%% Figure A.3: Counterfactual Path of phi_S
phiS_path = BM.phi_S + (BM.phi_R-BM.phi_S)./2.*(1./(1+exp(-0.22.*(year-1975))));
figure(103)
plot(year,phiS_path,LineStyle='-',LineWidth = 2,Color='k');
xlim([1949 2001]);
xticks(1950:10:2000);
ylim([-.01 .26]);
yticks(0:.05:.25);
set(gca,'box','off','TickDir','out','Fontsize',13);
xline(2001,'k');
yline(.26,'k');
ylabel('$\phi_S$','Interpreter','latex',FontSize=20,Rotation=0,Position=[1943 .12]);
grid on
%% Save Figure A.3 in PDF and EPS file formats.
saveas(gcf,'figA-3.pdf');
saveas(gcf,'figA-3','epsc');
%% Figure A.5: Labor's Share of Income in Manufacturing
figure(105)
plot(year(1:end-3),Data(1,1:end-3),LineStyle='-',LineWidth = 2,Color=.75.*ones(1,3));
text(1985,72,'Data','FontSize',12,Color=.75.*ones(1,3));
hold on
plot(year,BM.labor_share_t,LineStyle='-',LineWidth = 2,Color=.5.*ones(1,3));
text(1968,66.5,'Benchmark Model','FontSize',12,Color=.5.*ones(1,3));
plot(year,phiS_half_slow.labor_share_t,LineStyle='--',LineWidth = 2,Color='r');
text(1977,78,sprintf('Union bargainin power in ROC \nconverges to half of RB level in 2000'),'FontSize',12,'Color','r');
xlim([1949 2001]);
xticks(1950:10:2000);
ylim([54 86]);
yticks(55:5:85);
set(gca,'box','off','TickDir','out','Fontsize',13);
xline(2001,'k');
yline(86,'k');
ylabel('Labor Share of Income','Fontsize',13);
grid on
hold off
% set(gcf,"Position",[400 400 800 600])
%% Save Figure A.5 in PDF and EPS file formats.
saveas(gcf,'figA-5.pdf');
saveas(gcf,'figA-5','epsc');